#ifndef _SFS_DATA_SERVER_PROTO_HELPER_H_
#define _SFS_DATA_SERVER_PROTO_HELPER_H_

#include "DataSvrClient.h"

string ds_build_request_create_file(int32_t dir_id, int64_t file_id);
string ds_build_request_delete_file(int32_t dir_id, int64_t file_id);
string ds_build_request_read_file(int32_t dir_id, int64_t file_id, int64_t begin_pos, int32_t len);
string ds_build_request_write_file(int32_t dir_id, int64_t file_id, int64_t begin_pos, int32_t len, int32_t mode);
string ds_build_request_get_file_control_info(int32_t dir_id, int64_t file_id);
string ds_build_request_replicate(int32_t dir_id, int64_t file_id, int32_t src_ds_id, int64_t src_file_size, \
                                        vector<uint32_t> src_crcs);
string ds_build_request_truncate(int32_t dir_id, int64_t file_id, int64_t size);


int ds_parse_response_create_file(const char * response, int32_t & result);
int ds_parse_response_delete_file(const char * response, int32_t & result);
int ds_parse_response_read_file(const char * response, int32_t & result);
int ds_parse_response_write_file(const char * response, int32_t & result);
int ds_parse_response_get_file_control_info(const char * response, int32_t & result, DS_FILE_CONTROL_INFO & info, \
						int64_t & file_size);
int ds_parse_response_replicate(const char * response, int32_t & result);
int ds_parse_response_truncate(const char * response, int32_t & result);
#endif
